sysroot: Avoid double cleanup, and ensure no cleanup if specified
authorColin Walters <walters@verbum.org>
Thu, 8 Sep 2016 17:38:08 +0000 (13:38 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 8 Sep 2016 20:42:09 +0000 (20:42 +0000)
commit30aaffa9956cfb54183e6ddd9e425b064cb0bd74
treee868c0717f2e475d6bca44aadbc7e1b05917d4a8
parent82b756783be8c0bcbf7b84d2694dcbca9f58cd0e
sysroot: Avoid double cleanup, and ensure no cleanup if specified

Since forever, we've been doing two cleanups.  In
https://github.com/ostreedev/ostree/commit/8ece4d6d51bdbe3e41ab318259276bb83e553aa0
I thought we were doing just one and wanted to go to zero (if specified),
but I actually just dropped one cleanup.

In https://github.com/projectatomic/rpm-ostree/pull/452
@jlebon pointed out the duplication.  Fix this by creating a new internal
deploy wrapper that takes cleanup flags.

(Since we already had the "piecemeal cleanup" API internally, let's
 frame it in terms of that, rather than passing down a boolean).

Closes: #500
Approved by: jlebon
src/libostree/ostree-sysroot-deploy.c
src/libostree/ostree-sysroot-private.h
src/libostree/ostree-sysroot.c